% loading measurement files
clear all;
close all;
clc;
set(0, 'DefaultFigurePosition', [100, 100, 600, 500]);
set(0, 'DefaultAxesColor', 'none');
set(0, 'DefaultAxesFontName', 'Arial');
set(0, 'DefaultAxesFontSize', 36);
set(0, 'DefaultAxesTickLength', [0 0]); % [0.015 0.015]
set(0, 'DefaultAxesBox', 'on'); %on or off
set(0, 'DefaultAxesLineWidth', 4);
set(0, 'DefaultAxesXColor', [0 0 0]);
set(0, 'DefaultAxesYColor', [0 0 0]);
set(0, 'DefaultLineLineWidth', 2);
set(0, 'DefaultLegendBox', 'on');
set(0, 'DefaultLegendFontWeight', 'bold');
set(0, 'DefaultLegendItemTokenSize', [15, 18]);

path = 'C:\Users\woose\Desktop\WooSeokLee\After MIT\Tisdale Lab\MOCHA\DFT calculation\wavefunctions on kspace';
[FileName,PathName] = uigetfile('*.dat', 'Select data', path, 'MultiSelect','off');
data = table2array(readtable([PathName FileName]));

C=load('C.mat');
Cmap=C(1).C;

%%

kx = data(:,1);
ky = data(:,2);
i = data(:,4);

%%
[X,Y] = meshgrid(min(kx):0.01:max(kx), min(ky):0.01:max(ky));
Z = griddata(kx, ky, i, X, Y, 'cubic');
imagesc(X(1,:),Y(:,1),Z);
xlim([-0.4,0.4]);
ylim([-0.4,0.4]);
axis xy;

colormap(pink);

c = colorbar;
%caxis([-0.05 0.4]);
%c.Label.String = 'Normalized PL intensity';
c.Label.FontSize = 22;
c.Label.FontName = 'Arial';
c.LineWidth = 2;
c.TickLength = 0;

